package li.buda.rtracker.commands {
    import flash.utils.Dictionary;

    import li.buda.utils.flex.remoting.RemoteObjectInvoker;
    import li.buda.utils.flex.remoting.RemotingInvoker;

    public class AbstractCommand {

        public var onResult:Function;
        public var onFault:Function;

        protected var methodName:String;
        protected var parameters:Array;

        private var invoker:RemotingInvoker;

        public function AbstractCommand(source:String) {
            invoker = new RemoteObjectInvoker(source);
            parameters = [];
        }

        public function execute():void {
            invoker.invoke(methodName, parameters, onResult, onFault);
        }

    }
}